﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using TalentPools.Model;
namespace TalentPools.DAL
{
  public  class baseConfigService
  {
      #region 操作基本配置信息
      /// <summary>
      /// 操作基本配置信息
      /// </summary>
      /// <param name="key">配置信息的关键词</param>
      /// <returns></returns>
      public List<baseConfig> getconfigInfo(string key)
      {
          List<baseConfig> list = new List<baseConfig>();
          string sql = "select * from baseConfig where type=@key";
          SqlParameter[] par = {new SqlParameter("@key",key)};
          SqlDataReader read = SqlHelper.ExecuteReader(SqlHelper.ConnectionString,CommandType.Text,sql,par);
          while(read.Read())
          {
              baseConfig bc = new baseConfig();
              bc.key = read.GetString(1);
              bc.value = read.GetString(2);
              list.Add(bc);
          }
          return list;
      }
      #endregion
  }
}
